package com.msb.config;


import com.msb.bean.Book;
import com.msb.bean.Person;
import com.msb.bean.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author sunpeng
 * @Date 2021-07-13 15:12
 */
@Configuration
@ComponentScan(basePackages = "com.msbPuls")
public class MyConfig {

    @Bean
    public User getUser(){
        User user = new User();
        user.setName("sunpeng");
        return user;
    }

    @Bean
    public Person getPerson(User user){
        return new Person();
    }

    @Bean(value = "goodBook")
    public Book getBook(){
        return new Book();
    }
}
